-- card: 16917 from stack: in -- bmap block id: 17217 -- flags: 0000 -- background id: 2135 -- name: Diamond -- part 1 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=11 top=60 right=321 bottom=261 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: -- part 2 (field) -- low flags: 00 -- high flags: 0000 -- rect: left=262 top=60 right=334 bottom=508 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: -- part contents for background part 1 ----- text ----- 24 -- part contents for card part 1 ----- text ----- procedure DoNetwork; procedure DoDriver; procedure DoApp1; procedure DoApp2; procedure DoApp3; procedure DoApp4; procedure Init; function Next (eventMask: integer): Boolean; { returns True if an event of the type requested was found. } function Available (eventMask: integer): Boolean; { returns True if an event of the type requested is available. } procedure Loop; end; As shown in example 5, DoMouseDown first determines where the event occurred (by calling FindWindow). If the event occurred on the desktop, DoMouseDown does nothing. If the event occurred in a menu, it sends -- part contents for card part 2 ----- text ----- a message to the global menu bar object (theMenuBar) to dispatch a message to the appropriate object depending on the menu item that was chosen. If the mouse down event occurred in a system window, the system is allowed to handle it by a call to the Toolbox routine, SystemClick. If the event did not take place in any of the above locations, it assumes that the event was in a window and the appropriate message is sent to TWindow. Notice that the object reference is retrieved from the window record's refcon field. However, the refcon is defined as a LongInt and hence casting to the TWindow type is necessary for the compiler to accept the statement. When the window object was created, the object reference